<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <p id="noContextMenu">这个段落右键菜单已被禁用。</p>
</body>
</html>
<script>
  noContext = document.getElementById('noContextMenu');
  noContext.oncontextmenu = function(e) {
    var event = e || window.event
    event.returnValue = false
  }

  noContext.onmousedown = function(e) {
    console.log(e)
  }
</script>